/*
 * Ant Group
 * Copyright (c) 2004-2024 All Rights Reserved.
 */
package com.alipay.zmdepositdemo.controller;

import com.alipay.zmdepositdemo.model.CreditOrderModel;
import com.alipay.zmdepositdemo.model.OpenResponse;
import com.alipay.zmdepositdemo.service.create.DepositOrderCreateService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 免押订单创建模块
 *
 * @author zhangjian
 * @version DepositOrderCreateController.java, v 0.1 2024年07月03日 09:07 zhangjian
 */
@Api(tags = "创建免押订单")
@ApiSupport(order = 1)
@RestController
@RequestMapping(value = "/create-deposit-order")
public class DepositOrderCreateController {

    @Autowired
    private DepositOrderCreateService depositOrderCreateService;

    /**
     * 创建免押订单
     *
     * @see <a
     * href="https://opendocs.alipay.com/open/e2e70da4_alipay.fund.auth.order.app
     * .freeze?scene=3392871eb88945fa977f613f214ea1c6&pathHash=1002681c">...</a>
     */
    @ApiOperationSupport(order = 1)
    @ApiOperation(value = "创建免押订单接口")
    @PostMapping(value = "/create")
    public OpenResponse<String> createDepositOrder(
            @RequestBody CreditOrderModel creditOrderModel) {
        return depositOrderCreateService.createDepositOrder(creditOrderModel);
    }
}